import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 客户查重
 */
@Entity('customer_duplicate')
export class CustomerDuplicateEntity extends BaseEntity {
  @Index()
  @Column({ comment: '客户ID' })
  customerId: number;

  @Column({
    comment: '相似度',
    type: 'decimal',
    precision: 5,
    scale: 2,
    default: 0,
  })
  similarity: number;

  @Index()
  @Column({ comment: '重复客户ID', nullable: true })
  duplicateCustomerId: number;

  @Column({
    comment: '处理状态',
    dict: ['待处理', '已合并', '已忽略'],
    default: 0,
  })
  status: number;

  @Index()
  @Column({ comment: '处理人', nullable: true })
  userId: number;

  @Column({ comment: '处理时间', type: 'varchar', nullable: true })
  handleTime: Date;
}
